<template>
  <div class="notice-content">
    <div class="header">
      <span>Notifications</span>
      <el-button type="text" v-if="false">Clear All</el-button>
    </div>
    <div class="notice-content-content" v-show="data.length > 0">
      <notice-item v-for="(item,index) in data" :key="'data' + index" :detail="item"></notice-item>
    </div>
    <div class="no-data" v-show="data.length === 0">
      <span class="icon cuifont icon_mail_all_accounts"></span>
      <div>No notifications</div>
    </div>
  </div>
</template>

<script>
import noticeItem from "@/views/navBarComponent/navbar-notice/notice-item.vue";
export default {
  name: "notice-content",
  props: {
    data: {
      type: Array,
      default: function () {
        return []
      }
    }
  },
  components: {
    noticeItem
  }
}
</script>

<style scoped lang="scss">
.notice-content {
  .header {
    line-height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #0000000F;
    span {
      font-weight: bold;
    }
  }
  .notice-content-content {
    padding: 16px;
    max-height: 450px;
    overflow: auto;
  }
  .no-data {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #00000072;
    span {
      font-size: 56px;
      margin-bottom: 8px;
      color: #0000005B;
    }
  }
  .notice-item:last-child {
    margin-bottom: 0;
  }
}

</style>